<div th:fragment="baidu_link">
    <a th:href="@{http://baidu.com}">百度</a>
</div>

<div th:fragment="weibo_link">
    <a th:href="@{http://weibo.com}">微博</a>
</div>